document.addEventListener('DOMContentLoaded', function () {
    // 获取日历容器
    var calendarEl = document.getElementById('calendar');

    // 初始化日历
    var calendar = new FullCalendar.Calendar(calendarEl, {
        initialView: 'dayGridMonth',
        locale: 'zh-cn',
        selectable: true,
        aspectRatio: 1.8,
        dateClick: function (info) {
            alert(`你选择了日期：${info.dateStr}`);
        },
        events: [
            { title: '示例事件', start: '2025-03-01' },
            { title: '学习编程', start: '2025-03-02' }
        ]
    });

    // 渲染日历
    calendar.render();
});
